﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/MainTemplate.Master" AutoEventWireup="true" CodeBehind="MostPopular.aspx.cs" Inherits="AlexandriaPressWebsite.MasterPages.WebForm13" %>
<asp:Content ID="Content1" ContentPlaceHolderID="mainDoc" runat="server">

 <table style="width:100%;">
        <tr>
            <td style="height: 16px">
                <asp:Button ID="btnBook" runat="server" Text="Most Popular Book" 
                    onclick="btnBook_Click" CssClass="genericButton" />
            </td>
            <td style="height: 16px">
                <asp:Button ID="btnAuthor" runat="server" Text="Most Popular Author" 
                    onclick="btnAuthor_Click" CssClass="genericButton" />
            </td>
        </tr>
        <tr>
            <td style="height: 16px" colspan="2">
                <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" 
                    onselectedindexchanged="DropDownList1_SelectedIndexChanged" 
                    CssClass="secondaryList">
                    <asp:ListItem>Month</asp:ListItem>
                    <asp:ListItem Value="1">January</asp:ListItem>
                    <asp:ListItem Value="2">February</asp:ListItem>
                    <asp:ListItem Value="3">March</asp:ListItem>
                    <asp:ListItem Value="4">April</asp:ListItem>
                    <asp:ListItem Value="5">May</asp:ListItem>
                    <asp:ListItem Value="6">June</asp:ListItem>
                    <asp:ListItem Value="7">July</asp:ListItem>
                    <asp:ListItem Value="8">August</asp:ListItem>
                    <asp:ListItem Value="9">September</asp:ListItem>
                    <asp:ListItem Value="10">October</asp:ListItem>
                    <asp:ListItem Value="11">November</asp:ListItem>
                    <asp:ListItem Value="12">December</asp:ListItem>
                </asp:DropDownList>
                <asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True" 
                    onselectedindexchanged="DropDownList2_SelectedIndexChanged" CssClass="secondaryList" 
                 >
                    <asp:ListItem>Year</asp:ListItem>
                    <asp:ListItem>2012</asp:ListItem>
                </asp:DropDownList>
                <br />
            </td>
        </tr>
        <tr>
            <td colspan="2">           
            
                <asp:GridView ID="gridMostPopularBook" runat="server" 
                    AutoGenerateColumns="False" DataKeyNames="BookID"                
                    RowStyle-BorderStyle="None"  
                     PagerSettings-PageButtonCount="10" 
                     GridLines="None"
                     AllowPaging="True" 
                     OnPageIndexChanging="gridMostPopularBook_OnPageIndexChanging" 
                     BorderStyle="None" CssClass="grid" PageSize="8">
            <PagerSettings PageButtonCount="10" /> 
            
<RowStyle BorderStyle="None"></RowStyle>
                   <Columns>
                
                    <asp:TemplateField HeaderText="Book ID" visible="false" >
                        <ItemTemplate>
                        <asp:Label id="lblBookID" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "BookID") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Book Cover">
                        <ItemTemplate>
                            <asp:Image ID="Image1" runat="server" ImageUrl='<%#DataBinder.Eval(Container.DataItem, "BookCover")%>' AlternateText="Book Cover" CssClass="smallImage3" />                    
                        </ItemTemplate>                
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Title">
                        <ItemTemplate>
                            <asp:Label id="lblTitle" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Title") %>'></asp:Label>
                        </ItemTemplate>
                     </asp:TemplateField>
                    <asp:TemplateField HeaderText="Author Name">
                        <ItemTemplate>
                            <asp:Label id="lblFName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Name") %>'></asp:Label>
                        </ItemTemplate>
                     </asp:TemplateField>
                    <asp:TemplateField HeaderText="Copies Sold" Visible ="false" >
                        <ItemTemplate>
                        <asp:Label id="lblTotal" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Total") %>'></asp:Label>
                        </ItemTemplate>
                     </asp:TemplateField>
                </Columns>
                </asp:GridView>
                <asp:GridView ID="gridMostPopularAuthor" runat="server" 
                    AutoGenerateColumns="False" DataKeyNames="AuthorID"                
                    RowStyle-BorderStyle="None"  
                     PagerSettings-PageButtonCount="10" 
                     GridLines="None"
                     AllowPaging="True" 
                     OnPageIndexChanging="gridMostPopularAuthor_OnPageIndexChanging" 
                     BorderStyle="None" CssClass="grid" PageSize="8">
            <PagerSettings PageButtonCount="10" /> 
<RowStyle BorderStyle="None"></RowStyle>
                <Columns>
                
                    <asp:TemplateField HeaderText="Author ID" visible="false" >
                        <ItemTemplate>
                        <asp:Label id="lblAuthorID" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "AuthorID") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Profile Picture">
                        <ItemTemplate>
                        <asp:Image ID="Image1" runat="server" ImageUrl='<%#DataBinder.Eval(Container.DataItem, "ProfilePicture")%>' AlternateText="Profile Picture" CssClass="smallImage3" />
                            
                            
                        </ItemTemplate>                
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Author Name">
                        <ItemTemplate>
                            <asp:Label id="lblFName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Name") %>'></asp:Label>
                        </ItemTemplate>
                     </asp:TemplateField>
                    <asp:TemplateField HeaderText="Copies Sold" Visible = "false">
                        <ItemTemplate>
                        <asp:Label id="lblTotal" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Total") %>'></asp:Label>
                        </ItemTemplate>
                     </asp:TemplateField>
                </Columns>
                </asp:GridView>
                <asp:Label ID="lblPopular" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td style="height: 16px" colspan="2">
                &nbsp;</td>
        </tr>
    </table>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="formDoc" runat="server">
</asp:Content>
